import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:qlevar_router/qlevar_router.dart';
import 'package:magma/heartbeat/helpers/magma_constant.dart';
import 'package:magma/heartbeat/helpers/magma_router.dart';

void main() {
  MagmaRouter.init();
  runApp(const MeshApp());
}

class MeshApp extends StatelessWidget {
  const MeshApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      minTextAdapt: true,
      splitScreenMode: true,
      designSize: const Size(414, 896),
      builder: (context, child) {
        return MaterialApp.router(
          title: MagmaConstant.appName,
          debugShowCheckedModeBanner: false,
          theme: ThemeData(
            textButtonTheme: TextButtonThemeData(
              style: TextButton.styleFrom(
                textStyle: TextStyle(decoration: TextDecoration.none),
              ),
            ),
            primarySwatch: Colors.yellow,
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
            fontFamily: GoogleFonts.inter().fontFamily,
          ),
          routerDelegate: QRouterDelegate(MagmaRouter.routes),
          routeInformationParser: QRouteInformationParser(),
        );
      },
    );
  }
}
